import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.script.Random;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.Skills;
import com.speljohan.rsbot.script.wrappers.RSObject;
import com.speljohan.rsbot.script.wrappers.RSTile;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.Map;

public class WarXFlax extends Script implements PaintListener {

    public RSObject flax = null;

    RSTile[] goSpin = new RSTile[]{
            new RSTile(2725, 3491), new RSTile(2718, 3483),
            new RSTile(2716, 3473), new RSTile(2714, 3472)
    };

    RSTile[] toSpin = new RSTile[]{
            new RSTile(2744, 3443), new RSTile(2735, 3449),
            new RSTile(2728, 3457), new RSTile(2723, 3467),
            new RSTile(2714, 3472)

    };

    RSTile[] toWork = new RSTile[]{
            new RSTile(2725, 3492), new RSTile(2727, 3481),
            new RSTile(2727, 3470), new RSTile(2732, 3461),
            new RSTile(2735, 3450), new RSTile(2743, 3443)

    };
    RSTile[] path, path2;

    RSTile[] toBank = reversePath(toWork);

    RSTile spinTile = new RSTile(2716, 3472);
    RSTile bankTile = new RSTile(2725, 3491);
    RSTile workTile = new RSTile(2744, 3444);

    long hours = 0, minutes = 0, seconds = 0, time;
    long startTime, seconds2;
    long timeGained = 0;

    int startLevel = 0;
    int startXP = 0, anti;
    int loads = 0;
    int bankFail = 0, type = 0;
    int[] pickID = {2646};

    boolean checked = false;

    public javax.swing.JLabel jLabel1;
    public javax.swing.JLabel jLabel10;
    public javax.swing.JLabel jLabel11;
    public javax.swing.JLabel jLabel12;
    public javax.swing.JLabel jLabel13;
    public javax.swing.JLabel jLabel14;
    public javax.swing.JLabel jLabel15;
    public javax.swing.JLabel jLabel16;
    public javax.swing.JLabel jLabel2;
    public javax.swing.JLabel jLabel3;
    public javax.swing.JLabel jLabel4;
    public javax.swing.JLabel jLabel5;
    public javax.swing.JLabel jLabel6;
    public javax.swing.JLabel jLabel7;
    public javax.swing.JLabel jLabel8;
    public javax.swing.JLabel jLabel9;

    public double getVersion() {

        return 0.3;

    }

    public String getScriptCategory() {

        return "WarXperiment/Crafting";

    }

    public String getName() {

        return "WarXFlax";

    }

    public String getAuthor() {

        return "WarXperiment";

    }

    public String getScriptDescription() {
        return "<html>\n" + "<head></head>\n" + "<body>\n" + "<center>"
                + "<h2>"
                + getName()
                + "</h2>"
                + "</center>\n"
                + "<b>Author:</b> "
                + getAuthor()
                + "<br />"
                + "<b>Version:</b> "
                + getVersion()
                + "<br />"
                +

                "<b>Features:</b>"
                + "<li>Start in Seers Village BANK</li>"
                + "<li>Start with nothing in inventory</li>"
                + "------------------------------------------------------"
                + "<form>Bank:<input type=\"radio\" name=\"how\" value=\"bank\" checked=\"checked\"> "
                + "<br />Bank + Spin:<input type=\"radio\" name=\"how\" value=\"power\"><br />"
                + "Spin:<input type=\"radio\" name=\"how\" value=\"spin\"><br /></form>"
                + "<br />"
                + "<b>Bank</b> = Pick flax and then bank"
                + "<br />"
                + "<b>Bank + Spin</b> = Pick flax, spin then bank"
                + "<br />"
                + "<b>Spin</b> = Withdraws flax then spins it  <b>**FLAX MUST BE IN FIRST SLOT OF BANK**</b>"
                + "</body>\n" + "</html>";
    }

    public boolean onStart(Map<String, String> args) {
        if (args.get("how").equals("bank")) {
            type = 1;
        }
        if (args.get("how").equals("power")) {
            type = 2;
        }
        if (args.get("how").equals("spin")) {
            type = 3;
        }
        checked = false;
        loads = 0;
        bankFail = 0;
        int index = Skills.getStatIndex("crafting");
        startLevel = skills.getCurrentSkillLevel(index);
        startXP = skills.getCurrentSkillExp(index);
        new WJF().setVisible(true);
        startTime = System.currentTimeMillis();
       
        return true;
    }

    public void onFinish() {
        Bot.getEventManager().removeListener(PaintListener.class, this);
    }

    public int loop() {
        try {
            if (getMyPlayer().isInCombat() && !getMyPlayer().isMoving()) // If
            {
                runAway();
                return random(400, 700);

            }
            while (getMyPlayer().getAnimation() == 894 && !getMyPlayer().isInCombat()) {
                wait(random(900, 1100));
                return random(100, 200);
            }
            if (isLoggedIn() && startXP == 0) {
                int index = Skills.getStatIndex("Prayer");
                startLevel = skills.getCurrentSkillLevel(index);
                startXP = skills.getCurrentSkillExp(index);
            }
            if (bankFail >= 10) {
                log("Banking failed. Possibly ran out of gems or gold!");
                return -1;
            }
            if (type == 1) {
                if (!ready() && walkback()) {
                    return random(200, 3000);
                }
                if (!walkback() && openbank() && !ready()) {
                    return random(500, 800);
                }
                if (!openbank() && deposit() && !ready()) {
                    return random(500, 800);
                }
                if (walkthere() && ready()) {
                    return random(200, 3000);
                }
                if (ready() && !walkthere() && pick()) {
                    return random(500, 800);
                }
            }
            if (type == 2) {
                if (hasflax() && tospin() && !ready()) {
                    return random(200, 300);
                }
                if (!tospin() && opendoor1() && !climbladder1() && hasflax()) {
                    return random(500, 800);
                }
                if (!tospin() && !opendoor1() && climbladder1() && hasflax()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && startspin() && !clickspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && startspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && !startspin() && clickspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && !hasflax() && climbladder2()) {
                    return random(500, 800);
                }
                if (!walkback2() && openbank() && !ready()) {
                    return random(500, 800);
                }
                if (!openbank() && deposit() && !ready()) {
                    return random(500, 800);
                }
                if (walkthere() && ready()) {
                    return random(200, 300);
                }
                if (ready() && !walkthere() && pick()) {
                    return random(500, 800);
                }
            }
            if (type == 3) {

                if (hasflax() && tospin1()) {
                    return random(200, 300);
                }
                if (!tospin1() && opendoor() && !climbladder() && hasflax()) {
                    return random(500, 800);
                }
                if (!tospin1() && !opendoor() && climbladder() && hasflax()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && startspin() && !clickspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && startspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && hasflax() && !startspin() && clickspin()) {
                    return random(500, 800);
                }
                if (getPlane() == 1 && !hasflax() && climbladder2()) {
                    return random(500, 800);
                }
                if (walkback3() && opendoor()) {
                    return random(500, 800);
                }
                if (!opendoor() && !walkback3() && openbank1()) {
                    return random(500, 800);
                }
                if (!openbank1() && deposit1()) {
                    return random(500, 800);
                }
            }

        } catch (Exception e) {
            log("An exception has occurred.");
        }
        return 0;
    }

    public void runAway() { // running away and running back after a while
        RSObject ladderup = findObject(25938);
        if (getMyPlayer().isInCombat()) {
            atObject(ladderup, "climb-down");
            wait(random(2000, 3000));
        }
    }

    boolean climbladder2() {
        RSObject ladderup = findObject(25938);
        if (getPlane() == 1 && !hasflax()) {
            atObject(ladderup, "climb-down");
            return true;
        }
        return false;
    }

    boolean spinning() {
        if (getMyPlayer().getAnimation() != -1) {
            wait(random(3000, 4000));
            return true;
        }
        return false;
    }

    boolean clickspin() {
        if (getInterface(459).isValid()) {
            atInterface(459, 17, "all");
            wait(random(2000, 3000));
            return true;
        }
        return false;
    }

    boolean startspin() {
        RSObject spinner = findObject(2768);
        if (spinner != null && getMyPlayer().getAnimation() != 894) {
            if (getPlane() == 1 && !spinning() && !clickspin() && hasflax()) {
                if (!tileOnScreen(spinner.getLocation())) {
                    walkTileMM(new RSTile(spinner.getLocation().getX()
                            + random(-1, 1), spinner.getLocation().getY() - 1));
                }
                if (tileOnScreen(spinner.getLocation())&& getMyPlayer().getAnimation() != 894) {
                    wait(random(300, 500));
                    atObject(spinner, "spinning");
                    return true;
                }
            }
        }
        return false;
    }


    boolean climbladder() {
        RSObject ladderup = findObject(25938);
        if (getPlane() == 0 && !opendoor() && hasflax()) {
            atObject(ladderup, "climb-up");
            return true;
        }
        return false;
    }

    boolean climbladder1() {
        RSObject ladderup = findObject(25938);
        if (getPlane() == 0 && !opendoor() && hasflax() && !ready()) {
            atObject(ladderup, "climb-up");
            return true;
        }
        return false;
    }

    boolean opendoor() {
        RSObject object = findObject(25819);
        if (object != null) {
            if (distanceTo(object) <= 5) {
                atDoor(object, "West", "Open");
                return true;
            }
        }
        return false;
    }

    boolean opendoor1() {
        RSObject object = findObject(25819);
        if (object != null && !ready()) {
            if (distanceTo(object) <= 5) {
                atDoor(object, "West", "Open");
                return true;
            }
        }
        return false;
    }

    boolean tospin1() {
        if (distanceTo(spinTile) > 2 && getPlane() == 0 && hasflax()) {
            walkPathMM(goSpin);
            checked = false;
            return true;
        }
        return false;
    }

    boolean tospin() {
        if (distanceTo(spinTile) > 4 && !ready() && getPlane() == 0 && hasflax()) {
            walkPathMM(toSpin);
            return true;
        }
        return false;
    }

    boolean pick() {
        flax = findNearestObject(6, pickID);
        if (ready()) {
            if (!atObject(flax, "pick flax")) {
                turnToTile(flax.getLocation());
            }
            return true;
        }
        return true;
    }


    boolean deposit1() {
        if (!hasflax() && bank.getInterface().isValid()) {
            int strings = getInventoryCount(1777);
            if (bank.depositAllExcept()) {
                loads += strings;
                wait(random(200, 400));
                moveMouse(random(38, 74), random(92, 124));
                while (getTopText().equals("")) ;
                if (!getTopText().contains("flax")) {
                    bankFail++;
                }
                if (getTopText().contains("flax")) {
                    clickMouse(false);
                    wait(random(500, 800));
                    if (atMenu("Withdraw-All")) {
                        wait(random(1500, 1600));
                        bankFail = 0;

                    }
                }


            }
            return true;
        }
        return false;
    }

    boolean openbank1() {

        if (!hasflax() && !bank.getInterface().isValid()) {
            RSObject b = findObject(25808);
            if (b != null) {
                if (!tileOnScreen(b.getLocation()) && !getMyPlayer().isMoving()) {
                    walkTileMM(new RSTile(b.getLocation().getX()
                            + random(-1, 1), b.getLocation().getY() - 1));
                    wait(random(300, 500));
                    return true;
                } else if (tileOnScreen(b.getLocation())) {
                    if (!atObject(b, "Use-quickly")) {
                        turnToTile(b.getLocation());
                    }
                    return true;
                }
            }
        }
        return false;
    }

    boolean deposit() {
        if (!ready() && bank.getInterface().isValid()) {
            bank.depositAllExcept();
            loads++;
            return true;
        }
        return false;
    }

    boolean openbank() {
        if (!ready() && !bank.getInterface().isValid()) {
            RSObject b = findObject(25808);
            if (b != null) {
                if (!tileOnScreen(b.getLocation()) && !getMyPlayer().isMoving()) {
                    walkTileMM(new RSTile(b.getLocation().getX()
                            + random(-1, 1), b.getLocation().getY() - 1));
                    wait(random(300, 500));
                    return true;
                } else if (tileOnScreen(b.getLocation())) {
                    if (!atObject(b, "Use-quickly")) {
                        turnToTile(b.getLocation());
                    }
                    return true;
                }
            }
        }
        return false;
    }

    boolean ready() {
        if (!isInventoryFull()) {
            return true;
        }
        return false;
    }

    boolean hasflax() {
        if (inventoryContains(1779)) {
            return true;
        }
        return false;
    }

    boolean walkback() {
        if (distanceTo(bankTile) > 7 && !ready()) {
            walkPathMM(toBank);
            return true;
        }
        return false;
    }

    boolean walkthere() {
        if (distanceTo(workTile) > 7 && ready()) {
            walkPathMM(toWork);
            return true;
        }
        return false;
    }

    boolean walkback2() {
        if (!opendoor() && distanceTo(bankTile) > 7 && !hasflax() && getPlane() == 0 && !ready()) {
            walkPathMM(toBank);
            return true;
        }
        return false;
    }

    boolean walkback3() {
        if (!opendoor() && distanceTo(bankTile) > 7 && !hasflax() && getPlane() == 0) {
            walkPathMM(toBank);
            return true;
        }
        return false;
    }

    private void keyEvent(String event) {
        if (event.equals("enter")) {
            Bot.getInputManager().holdKey(KeyEvent.VK_ENTER, 100);
        }
        if (event.equals("erase")) {
            Bot.getInputManager().holdKey(KeyEvent.VK_BACK_SPACE, random(2000, 4000));
        }
    }

    public String getTopText() {
        return getMenuItems().get(0).toLowerCase();
    }

    public boolean walkPathMM(RSTile[] path) {
        return walkPathMM(path, 0);
    }


    public boolean walkPathMM(RSTile[] path, int rand) { // walking by Fusion89k
        try {
            if (getMyPlayer().isMoving()
                    && (getDestination() != null && (distanceTo(getDestination()) > 6 || distanceBetween(
                    getDestination(), path[path.length - 1]) < 4))) {//Check for movement and distance to the flag as well as distance to the end
                for (Random random : Bot.getScriptHandler().getRandoms()) {//Since this method doesn't return is has builtin random check
                    random.runRandom();
                }
                wait(random(300, 600));
            }
            if (distanceTo(path[path.length - 1]) < 5)//If we are there, then we are done
                return true;
            if (getEnergy() >= random(60, 100))//Set the run.  Checks every time before we click
                setRun(true);
            int loc = 0;
            RSTile start = path[0];//This part locates where we are in the array.
            for (int i = 1; i < path.length; i++) {
                if (distanceTo(path[i]) < distanceTo(start)) {
                    start = path[i];
                    loc = i;
                }
            }
            RSTile walker;//Selects which tile we should walk next.  Just a safeguard against outOfBoundsException
            if (loc == path.length - 1)
                walker = path[loc];
            else
                walker = path[loc + 1];
            //Walks to a random tile.  The tile of the array is the center point
            walkTileMM(new RSTile(walker.getX() + random((-1 * rand), rand + 0), walker.getY() + random((-1 * rand), rand + 0)));
            wait(random(300, 600));
            return walkPathMM(path, rand);//Recursively calls until we have reached our destination or an error;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    public RSObject findNearestObject(int range, int[] ids) {
        int Dist = 20;
        RSObject closest = null;
        int minX = getMyPlayer().getLocation().getX() - range;
        int minY = getMyPlayer().getLocation().getY() - range;
        int maxX = getMyPlayer().getLocation().getX() + range;
        int maxY = getMyPlayer().getLocation().getY() + range;
        for (int x = minX; x < maxX; x++) {
            for (int y = minY; y < maxY; y++) {
                RSObject o = getObjectAt(x, y);
                if (o != null) {
                    try {
                        for (int id : ids) {
                            if (id != o.getID()) {
                                continue;
                            }
                            int distance = distanceTo(o);
                            if (distance < Dist) {
                                Dist = distance;
                                closest = o;
                            }
                        }
                    }
                    catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        return closest;
    }

    public void onRepaint(Graphics g) {

        if (startTime == 0) {
            startTime = System.currentTimeMillis();
        }
        long millis = System.currentTimeMillis() - startTime;
        time = System.currentTimeMillis() - startTime;
        seconds2 = millis / 1000;
        seconds = time / 1000;
        if (seconds >= 60) {
            minutes = seconds / 60;
            seconds -= minutes * 60;
        }
        if (minutes >= 60) {
            hours = minutes / 60;
            minutes -= hours * 60;
        }
        if (isLoggedIn()) {
            int index = Skills.getStatIndex("crafting");
            int XPChange = skills.getCurrentSkillExp(index) - startXP;
            if (type == 1) {
                jLabel7.setText("");

                jLabel8.setText("");

                jLabel9.setText("");

                jLabel10.setText("");

                jLabel11.setText("0");

                jLabel12.setText("0");

                jLabel13.setText("");

                jLabel14.setText("");

                jLabel15.setText("");

                jLabel16.setText("");

                jLabel5.setText("Flax picked:");
                jLabel6.setText("Flax per hour:");
                jLabel11.setText("" + loads * 28);
                if (seconds != 0) {
                    jLabel12.setText("" + (loads * 28) * 3600 / seconds2);
                } else {
                    jLabel12.setText("" + (loads * 28) * 3600);
                }
            }

            if (type == 2) {
                jLabel7.setText("Exp Gained");

                jLabel8.setText("Exp per hour");

                jLabel9.setText("Crafting level");

                jLabel10.setText("Next lvl in");


                jLabel13.setText("" + XPChange + " exp");

                jLabel15.setText("" + skills.getCurrentSkillLevel(index));

                jLabel16.setText("" + skills.getXPToNextLevel(index) + " exp");

                jLabel5.setText("Flax spun:");
                jLabel6.setText("Flax per hour:");
                jLabel11.setText("" + loads * 28);
                if (seconds != 0) {
                    jLabel12.setText("" + (loads * 28) * 3600 / seconds2);
                    jLabel14.setText("" + XPChange * 3600 / seconds2 + " exp");
                } else {
                    jLabel12.setText("" + (loads * 28) * 3600);
                    jLabel14.setText("" + XPChange * 3600 + " exp");
                }
            }
            if (type == 3) {
                jLabel7.setText("Exp Gained");

                jLabel8.setText("Exp per hour");

                jLabel9.setText("Crafting level");

                jLabel10.setText("Next lvl in");


                jLabel13.setText("" + XPChange + " exp");


                jLabel15.setText("" + skills.getCurrentSkillLevel(index));

                jLabel16.setText("" + skills.getXPToNextLevel(index) + " exp");

                jLabel5.setText("Flax spun:");
                jLabel6.setText("Flax per hour:");
                jLabel11.setText("" + loads);
                if (seconds != 0) {
                    jLabel12.setText("" + loads * 3600 / seconds2);
                    jLabel14.setText("" + XPChange * 3600 / seconds2 + " exp");
                } else {
                    jLabel12.setText("" + loads * 3600);
                    jLabel14.setText("" + XPChange * 3600 + " exp");
                }
            }

            long startTime;
            int oldTime;


            startTime = seconds;
            if (startTime != timeGained) {
                jLabel2.setText("h : " + hours);
                jLabel3.setText("m : " + minutes);
                jLabel4.setText("s : " + seconds);

                timeGained = seconds;
            }

        }

    }

    public class WJF extends javax.swing.JFrame {

        /**
         * Creates new form WJF
         */
        public WJF() {
            initComponents();
        }

        /**
         * This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {

            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();

            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

            jLabel1.setText("RunTime:");

            jLabel2.setText("h:");

            jLabel3.setText("m:");

            jLabel4.setText("s:");

            jLabel5.setText("0");

            jLabel6.setText("0");

            jLabel7.setText("0");

            jLabel8.setText("0");

            jLabel9.setText("0");

            jLabel10.setText("0");

            jLabel11.setText("0");

            jLabel12.setText("0");

            jLabel13.setText("0");

            jLabel14.setText("0");

            jLabel15.setText("0");

            jLabel16.setText("0");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(jLabel1)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel2)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel3)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel4))
                                    .addGroup(layout.createSequentialGroup()
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel6)
                                                    .addComponent(jLabel7))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel13)
                                            .addComponent(jLabel12)))
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(jLabel5)
                                            .addGap(18, 18, 18)
                                            .addComponent(jLabel11))
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                            .addComponent(jLabel10)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel16))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                            .addComponent(jLabel9)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel15))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel8)
                                    .addGap(18, 18, 18)
                                    .addComponent(jLabel14))))
                            .addContainerGap(61, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel11))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel12))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel13))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel14))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel15))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel16))
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );

            pack();
        }// </editor-fold>

        /**
         * @param args the command line arguments
         */
        public void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new WJF().setVisible(true);
                }
            });
        }

        // Variables declaration - do not modify

        // End of variables declaration

    }
}
